﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Markup;

namespace DiscoveryLogic.UI.Layouts
{
    public class XamlLoader<T> where T :class  
    {

        public static T Create(string s)
        {
            return Create(s, false); 
        } 

        public static T  Create ( string s, bool createNamescope )
        {
            System.Diagnostics.Debug.Assert(s.Contains("http://schemas.microsoft.com/client/2007")); 

                //T ret= XamlReader.Load ( s, createNamescope ) as T ;
                T ret = XamlReader.Load(s) as T;
                
                System.Diagnostics.Debug.Assert(ret != null); 
                return ret; 
        } 
    }
}
